package link.anyauto.fsmgr;

import android.app.Application;
import android.os.Handler;

/**
 * Created by Administrator on 2016/7/17.
 */
public class FsmgrApp extends Application {

    private static FsmgrApp app;
    private static Handler handler;

    @Override
    public void onCreate() {
        super.onCreate();
        handler = new Handler();
        app = this;
    }

    public static FsmgrApp getInstance() {
        return app;
    }

    public static Handler getUniversalHandler() {
        return handler;
    }

    public static String stringRes(int resId) {
        return app.getString(resId);
    }

    public static String[] getStringArrRes(int resId) {
        return app.getResources().getStringArray(resId);
    }

    public static String stringRes(int resId, Object ...args) {
        return app.getString(resId, args);
    }

    public static void post(Runnable runnable) {
        handler.post(runnable);
    }
}
